package com.dminvoicemanager.services;

import com.dminvoicemanager.objects.Const;

import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class RebootTrigger extends BroadcastReceiver {
	 @Override
	 public void onReceive(Context context, Intent intent) {
	  if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
		  
		  Intent intent1 = new Intent(context, MinuteAlarm.class);
			
			boolean alarmUp = (PendingIntent.getBroadcast(context, 0, intent1,PendingIntent.FLAG_NO_CREATE) != null);

			if (!alarmUp)//Fire Only if not fired
			{
				MinuteAlarm ma = new MinuteAlarm(context,Const.initialDelaySeconds,Const.repeatEveryMinutes);//1-First Alarm Delay Seconds  5- Repeat Every 5 minutes
			}
		  //MinuteAlarm ma = new MinuteAlarm(context,5);
	  }
	 }
}
